
local dclm = require 'dclm'

local sortme = {
  {v = 1, name = 'a'};
  {v = 1, name = 'b'};
  {v = 1, name = 'c'};
  {v = 1, name = 'd'};
  {v = 1, name = 'e'};
  {v = 1, name = 'f'};
}

print "before:"
for i,v in ipairs(sortme) do
  print(i, v.v, v.name)
end

local result = dclm.mergesort(sortme, function(a,b)  return a.v > b.v;  end)

print "after:"
for i,v in ipairs(result) do
  print(i, v.v, v.name)
end
